package com.ruoyi.irtu.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.irtu.mapper.IrtuProjectMapper;
import com.ruoyi.irtu.domain.IrtuProject;
import com.ruoyi.irtu.service.IIrtuProjectService;

/**
 * 项目Service业务层处理
 * 
 * @author wb
 * @date 2023-03-05
 */
@Service
public class IrtuProjectServiceImpl implements IIrtuProjectService 
{
    @Autowired
    private IrtuProjectMapper irtuProjectMapper;

    /**
     * 查询项目
     * 
     * @param projectId 项目主键
     * @return 项目
     */
    @Override
    public IrtuProject selectIrtuProjectByProjectId(Long projectId)
    {
        return irtuProjectMapper.selectIrtuProjectByProjectId(projectId);
    }

    /**
     * 查询项目列表
     * 
     * @param irtuProject 项目
     * @return 项目
     */
    @Override
    public List<IrtuProject> selectIrtuProjectList(IrtuProject irtuProject)
    {
        return irtuProjectMapper.selectIrtuProjectList(irtuProject);
    }

    /**
     * 新增项目
     * 
     * @param irtuProject 项目
     * @return 结果
     */
    @Override
    public int insertIrtuProject(IrtuProject irtuProject)
    {
        irtuProject.setCreateTime(DateUtils.getNowDate());
        return irtuProjectMapper.insertIrtuProject(irtuProject);
    }

    /**
     * 修改项目
     * 
     * @param irtuProject 项目
     * @return 结果
     */
    @Override
    public int updateIrtuProject(IrtuProject irtuProject)
    {
        irtuProject.setUpdateTime(DateUtils.getNowDate());
        return irtuProjectMapper.updateIrtuProject(irtuProject);
    }

    /**
     * 批量删除项目
     * 
     * @param projectIds 需要删除的项目主键
     * @return 结果
     */
    @Override
    public int deleteIrtuProjectByProjectIds(Long[] projectIds)
    {
        return irtuProjectMapper.deleteIrtuProjectByProjectIds(projectIds);
    }

    /**
     * 删除项目信息
     * 
     * @param projectId 项目主键
     * @return 结果
     */
    @Override
    public int deleteIrtuProjectByProjectId(Long projectId)
    {
        return irtuProjectMapper.deleteIrtuProjectByProjectId(projectId);
    }
}
